<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html><head>
<title>A User's Guide to the Z-Shell</title>
<link rev="made" href="mailto:p.w.stephenson@ntlworld.com">
</head>
<body>
<hr>
<h1>A User's Guide to the Z-Shell</h1>
<h2>Peter Stephenson</h2>
<h2>2003/03/23</h2>

<h1>Table of Contents</h1>
<dl>
<dt><h2><a href="zshguide01.html#l1">Chapter 1: A short introduction</a></h2></dt>
<dl>
<dt><h3><a href="zshguide01.html#l2">1.1: Other shells and other guides</a></h3></dt>
<dt><h3><a href="zshguide01.html#l3">1.2: Versions of zsh</a></h3></dt>
<dt><h3><a href="zshguide01.html#l4">1.3: Conventions</a></h3></dt>
<dt><h3><a href="zshguide01.html#l5">1.4: Acknowledgments</a></h3></dt>
</dl>
<dt><h2><a href="zshguide02.html#l6">Chapter 2: What to put in your startup files</a></h2></dt>
<dl>
<dt><h3><a href="zshguide02.html#l7">2.1: Types of shell: interactive and login shells</a></h3></dt>
<dl>
<dt><a href="zshguide02.html#l8">2.1.1: What is a login shell? Simple tests</a></dt>
</dl>
<dt><h3><a href="zshguide02.html#l9">2.2: All the startup files</a></h3></dt>
<dt><h3><a href="zshguide02.html#l10">2.3: Options</a></h3></dt>
<dt><h3><a href="zshguide02.html#l11">2.4: Parameters</a></h3></dt>
<dl>
<dt><a href="zshguide02.html#l12">2.4.1: Arrays</a></dt>
</dl>
<dt><h3><a href="zshguide02.html#l13">2.5: What to put in your startup files</a></h3></dt>
<dl>
<dt><a href="zshguide02.html#l14">2.5.1: Compatibility options: <code>SH_WORD_SPLIT</code> and others</a></dt>
<dt><a href="zshguide02.html#l15">2.5.2: Options for csh junkies</a></dt>
<dt><a href="zshguide02.html#l16">2.5.3: The history mechanism: types of history</a></dt>
<dt><a href="zshguide02.html#l17">2.5.4: Setting up history</a></dt>
<dt><a href="zshguide02.html#l18">2.5.5: History options</a></dt>
<dt><a href="zshguide02.html#l19">2.5.6: Prompts</a></dt>
<dt><a href="zshguide02.html#l20">2.5.7: Named directories</a></dt>
<dt><a href="zshguide02.html#l21">2.5.8: `Go faster' options for power users</a></dt>
<dt><a href="zshguide02.html#l22">2.5.9: aliases</a></dt>
<dt><a href="zshguide02.html#l23">2.5.10: Environment variables</a></dt>
<dt><a href="zshguide02.html#l24">2.5.11: Path</a></dt>
<dt><a href="zshguide02.html#l25">2.5.12: Mail</a></dt>
<dt><a href="zshguide02.html#l26">2.5.13: Other path-like things</a></dt>
<dt><a href="zshguide02.html#l27">2.5.14: Version-specific things</a></dt>
<dt><a href="zshguide02.html#l28">2.5.15: Everything else</a></dt>
</dl>
</dl>
<dt><h2><a href="zshguide03.html#l29">Chapter 3: Dealing with basic shell syntax</a></h2></dt>
<dl>
<dt><h3><a href="zshguide03.html#l30">3.1: External commands</a></h3></dt>
<dt><h3><a href="zshguide03.html#l31">3.2: Builtin commands</a></h3></dt>
<dl>
<dt><a href="zshguide03.html#l32">3.2.1: Builtins for printing</a></dt>
<dt><a href="zshguide03.html#l33">3.2.2: Other builtins just for speed</a></dt>
<dt><a href="zshguide03.html#l34">3.2.3: Builtins which change the shell's state</a></dt>
<dt><a href="zshguide03.html#l35">3.2.4: cd and friends</a></dt>
<dt><a href="zshguide03.html#l36">3.2.5: Command control and information commands</a></dt>
<dt><a href="zshguide03.html#l37">3.2.6: Parameter control</a></dt>
<dt><a href="zshguide03.html#l38">3.2.7: History control commands</a></dt>
<dt><a href="zshguide03.html#l39">3.2.8: Job control and process control</a></dt>
<dt><a href="zshguide03.html#l40">3.2.9: Terminals, users, etc.</a></dt>
<dt><a href="zshguide03.html#l41">3.2.10: Syntactic oddments</a></dt>
<dt><a href="zshguide03.html#l42">3.2.11: More precommand modifiers: <code>exec</code>, <code>noglob</code></a></dt>
<dt><a href="zshguide03.html#l43">3.2.12: Testing things</a></dt>
<dt><a href="zshguide03.html#l44">3.2.13: Handling options to functions and scripts</a></dt>
<dt><a href="zshguide03.html#l45">3.2.14: Random file control things</a></dt>
<dt><a href="zshguide03.html#l46">3.2.15: Don't watch this space, watch some other</a></dt>
<dt><a href="zshguide03.html#l47">3.2.16: And also</a></dt>
</dl>
<dt><h3><a href="zshguide03.html#l48">3.3: Functions</a></h3></dt>
<dl>
<dt><a href="zshguide03.html#l49">3.3.1: Loading functions</a></dt>
<dt><a href="zshguide03.html#l50">3.3.2: Function parameters</a></dt>
<dt><a href="zshguide03.html#l51">3.3.3: Compiling functions</a></dt>
</dl>
<dt><h3><a href="zshguide03.html#l52">3.4: Aliases</a></h3></dt>
<dt><h3><a href="zshguide03.html#l53">3.5: Command summary</a></h3></dt>
<dt><h3><a href="zshguide03.html#l54">3.6: Expansions and quotes</a></h3></dt>
<dl>
<dt><a href="zshguide03.html#l55">3.6.1: History expansion</a></dt>
<dt><a href="zshguide03.html#l56">3.6.2: Alias expansion</a></dt>
<dt><a href="zshguide03.html#l57">3.6.3: Process, parameter, command, arithmetic and brace expansion</a></dt>
<dt><a href="zshguide03.html#l58">3.6.4: Filename Expansion</a></dt>
<dt><a href="zshguide03.html#l59">3.6.5: Filename Generation</a></dt>
</dl>
<dt><h3><a href="zshguide03.html#l60">3.7: Redirection: greater-thans and less-thans</a></h3></dt>
<dl>
<dt><a href="zshguide03.html#l61">3.7.1: Clobber</a></dt>
<dt><a href="zshguide03.html#l62">3.7.2: File descriptors</a></dt>
<dt><a href="zshguide03.html#l63">3.7.3: Appending, here documents, here strings, read write</a></dt>
<dt><a href="zshguide03.html#l64">3.7.4: Clever tricks: exec and other file descriptors</a></dt>
<dt><a href="zshguide03.html#l65">3.7.5: Multios</a></dt>
</dl>
<dt><h3><a href="zshguide03.html#l66">3.8: Shell syntax: loops, (sub)shells and so on</a></h3></dt>
<dl>
<dt><a href="zshguide03.html#l67">3.8.1: Logical command connectors</a></dt>
<dt><a href="zshguide03.html#l68">3.8.2: Structures</a></dt>
<dt><a href="zshguide03.html#l69">3.8.3: Subshells and current shell constructs</a></dt>
<dt><a href="zshguide03.html#l70">3.8.4: Subshells and current shells</a></dt>
</dl>
<dt><h3><a href="zshguide03.html#l71">3.9: Emulation and portability</a></h3></dt>
<dl>
<dt><a href="zshguide03.html#l72">3.9.1: Differences in detail</a></dt>
<dt><a href="zshguide03.html#l73">3.9.2: Making your own scripts and functions portable</a></dt>
</dl>
<dt><h3><a href="zshguide03.html#l74">3.10: Running scripts</a></h3></dt>
</dl>
<dt><h2><a href="zshguide04.html#l75">Chapter 4: The Z-Shell Line Editor</a></h2></dt>
<dl>
<dt><h3><a href="zshguide04.html#l76">4.1: Introducing zle</a></h3></dt>
<dl>
<dt><a href="zshguide04.html#l77">4.1.1: The simple facts</a></dt>
<dt><a href="zshguide04.html#l78">4.1.2: Vi mode</a></dt>
</dl>
<dt><h3><a href="zshguide04.html#l79">4.2: Basic editing</a></h3></dt>
<dl>
<dt><a href="zshguide04.html#l80">4.2.1: Moving</a></dt>
<dt><a href="zshguide04.html#l81">4.2.2: Deleting</a></dt>
<dt><a href="zshguide04.html#l82">4.2.3: More deletion</a></dt>
</dl>
<dt><h3><a href="zshguide04.html#l83">4.3: Fancier editing</a></h3></dt>
<dl>
<dt><a href="zshguide04.html#l84">4.3.1: Options controlling zle</a></dt>
<dt><a href="zshguide04.html#l85">4.3.2: The minibuffer and extended commands</a></dt>
<dt><a href="zshguide04.html#l86">4.3.3: Prefix (digit) arguments</a></dt>
<dt><a href="zshguide04.html#l87">4.3.4: Words, regions and marks</a></dt>
<dt><a href="zshguide04.html#l88">4.3.5: Regions and marks</a></dt>
</dl>
<dt><h3><a href="zshguide04.html#l89">4.4: History and searching</a></h3></dt>
<dl>
<dt><a href="zshguide04.html#l90">4.4.1: Moving through the history</a></dt>
<dt><a href="zshguide04.html#l91">4.4.2: Searching through the history</a></dt>
<dt><a href="zshguide04.html#l92">4.4.3: Extracting words from the history</a></dt>
</dl>
<dt><h3><a href="zshguide04.html#l93">4.5: Binding keys and handling keymaps</a></h3></dt>
<dl>
<dt><a href="zshguide04.html#l94">4.5.1: Simple key bindings</a></dt>
<dt><a href="zshguide04.html#l95">4.5.2: Removing key bindings</a></dt>
<dt><a href="zshguide04.html#l96">4.5.3: Function keys and so on</a></dt>
<dt><a href="zshguide04.html#l97">4.5.4: Binding strings instead of commands</a></dt>
<dt><a href="zshguide04.html#l98">4.5.5: Keymaps</a></dt>
</dl>
<dt><h3><a href="zshguide04.html#l99">4.6: Advanced editing</a></h3></dt>
<dl>
<dt><a href="zshguide04.html#l100">4.6.1: Multi-line editing</a></dt>
<dt><a href="zshguide04.html#l101">4.6.2: The builtin vared and the function zed</a></dt>
<dt><a href="zshguide04.html#l102">4.6.3: The buffer stack</a></dt>
</dl>
<dt><h3><a href="zshguide04.html#l103">4.7: Extending zle</a></h3></dt>
<dl>
<dt><a href="zshguide04.html#l104">4.7.1: Widgets</a></dt>
<dt><a href="zshguide04.html#l105">4.7.2: Executing other widgets</a></dt>
<dt><a href="zshguide04.html#l106">4.7.3: Some special builtin widgets and their uses</a></dt>
<dt><a href="zshguide04.html#l107">4.7.4: Special parameters: normal text</a></dt>
<dt><a href="zshguide04.html#l108">4.7.5: Other special parameters</a></dt>
<dt><a href="zshguide04.html#l109">4.7.6: Reading keys and using the minibuffer</a></dt>
<dt><a href="zshguide04.html#l110">4.7.7: Examples</a></dt>
</dl>
</dl>
<dt><h2><a href="zshguide05.html#l111">Chapter 5: Substitutions</a></h2></dt>
<dl>
<dt><h3><a href="zshguide05.html#l112">5.1: Quoting</a></h3></dt>
<dl>
<dt><a href="zshguide05.html#l113">5.1.1: Backslashes</a></dt>
<dt><a href="zshguide05.html#l114">5.1.2: Single quotes</a></dt>
<dt><a href="zshguide05.html#l115">5.1.3: POSIX quotes</a></dt>
<dt><a href="zshguide05.html#l116">5.1.4: Double quotes</a></dt>
<dt><a href="zshguide05.html#l117">5.1.5: Backquotes</a></dt>
</dl>
<dt><h3><a href="zshguide05.html#l118">5.2: Modifiers and what they modify</a></h3></dt>
<dt><h3><a href="zshguide05.html#l119">5.3: Process Substitution</a></h3></dt>
<dt><h3><a href="zshguide05.html#l120">5.4: Parameter substitution</a></h3></dt>
<dl>
<dt><a href="zshguide05.html#l121">5.4.1: Using arrays</a></dt>
<dt><a href="zshguide05.html#l122">5.4.2: Using associative arrays</a></dt>
<dt><a href="zshguide05.html#l123">5.4.3: Substituted substitutions, top- and tailing, etc.</a></dt>
<dt><a href="zshguide05.html#l124">5.4.4: Flags for options: splitting and joining</a></dt>
<dt><a href="zshguide05.html#l125">5.4.5: Flags for options: <code>GLOB_SUBST</code> and <code>RC_EXPAND_PARAM</code></a></dt>
<dt><a href="zshguide05.html#l126">5.4.6: Yet more parameter flags</a></dt>
<dt><a href="zshguide05.html#l127">5.4.7: A couple of parameter substitution tricks</a></dt>
<dt><a href="zshguide05.html#l128">5.4.8: Nested parameter substitutions</a></dt>
</dl>
<dt><h3><a href="zshguide05.html#l129">5.5: That substitution again</a></h3></dt>
<dt><h3><a href="zshguide05.html#l130">5.6: Arithmetic Expansion</a></h3></dt>
<dl>
<dt><a href="zshguide05.html#l131">5.6.1: Entering and outputting bases</a></dt>
<dt><a href="zshguide05.html#l132">5.6.2: Parameter typing</a></dt>
</dl>
<dt><h3><a href="zshguide05.html#l133">5.7: Brace Expansion and Arrays</a></h3></dt>
<dt><h3><a href="zshguide05.html#l134">5.8: Filename Expansion</a></h3></dt>
<dt><h3><a href="zshguide05.html#l135">5.9: Filename Generation and Pattern Matching</a></h3></dt>
<dl>
<dt><a href="zshguide05.html#l136">5.9.1: Comparing patterns and regular expressions</a></dt>
<dt><a href="zshguide05.html#l137">5.9.2: Standard features</a></dt>
<dt><a href="zshguide05.html#l138">5.9.3: Extensions usually available</a></dt>
<dt><a href="zshguide05.html#l139">5.9.4: Extensions requiring <code>EXTENDED_GLOB</code></a></dt>
<dt><a href="zshguide05.html#l140">5.9.5: Recursive globbing</a></dt>
<dt><a href="zshguide05.html#l141">5.9.6: Glob qualifiers</a></dt>
<dt><a href="zshguide05.html#l142">5.9.7: Globbing flags: alter the behaviour of matches</a></dt>
<dt><a href="zshguide05.html#l143">5.9.8: The function <code>zmv</code></a></dt>
</dl>
</dl>
<dt><h2><a href="zshguide06.html#l144">Chapter 6: Completion, old and new</a></h2></dt>
<dl>
<dt><h3><a href="zshguide06.html#l145">6.1: Completion and expansion</a></h3></dt>
<dt><h3><a href="zshguide06.html#l146">6.2: Configuring completion using shell options</a></h3></dt>
<dl>
<dt><a href="zshguide06.html#l147">6.2.1: Ambiguous completions</a></dt>
<dt><a href="zshguide06.html#l148">6.2.2: <code>ALWAYS_LAST_PROMPT</code></a></dt>
<dt><a href="zshguide06.html#l149">6.2.3: Menu completion and menu selection</a></dt>
<dt><a href="zshguide06.html#l150">6.2.4: Other ways of changing completion behaviour</a></dt>
<dt><a href="zshguide06.html#l151">6.2.5: Changing the way completions are displayed</a></dt>
</dl>
<dt><h3><a href="zshguide06.html#l152">6.3: Getting started with new completion</a></h3></dt>
<dt><h3><a href="zshguide06.html#l153">6.4: How the shell finds the right completions</a></h3></dt>
<dl>
<dt><a href="zshguide06.html#l154">6.4.1: Contexts</a></dt>
<dt><a href="zshguide06.html#l155">6.4.2: Tags</a></dt>
</dl>
<dt><h3><a href="zshguide06.html#l156">6.5: Configuring completion using styles</a></h3></dt>
<dl>
<dt><a href="zshguide06.html#l157">6.5.1: Specifying completers and their options</a></dt>
<dt><a href="zshguide06.html#l158">6.5.2: Changing the format of listings: groups etc.</a></dt>
<dt><a href="zshguide06.html#l159">6.5.3: Styles affecting particular completions</a></dt>
</dl>
<dt><h3><a href="zshguide06.html#l160">6.6: Command widgets</a></h3></dt>
<dl>
<dt><a href="zshguide06.html#l161">6.6.1: <code>_complete_help</code></a></dt>
<dt><a href="zshguide06.html#l162">6.6.2: <code>_correct_word</code>, <code>_correct_filename</code>, <code>_expand_word</code></a></dt>
<dt><a href="zshguide06.html#l163">6.6.3: <code>_history_complete_word</code></a></dt>
<dt><a href="zshguide06.html#l164">6.6.4: <code>_most_recent_file</code></a></dt>
<dt><a href="zshguide06.html#l165">6.6.5: <code>_next_tags</code></a></dt>
<dt><a href="zshguide06.html#l166">6.6.6: <code>_bash_completions</code></a></dt>
<dt><a href="zshguide06.html#l167">6.6.7: <code>_read_comp</code></a></dt>
<dt><a href="zshguide06.html#l168">6.6.8: <code>_generic</code></a></dt>
<dt><a href="zshguide06.html#l169">6.6.9: <code>predict-on</code>, <code>incremental-complete-word</code></a></dt>
</dl>
<dt><h3><a href="zshguide06.html#l170">6.7: Matching control and controlling where things are inserted</a></h3></dt>
<dl>
<dt><a href="zshguide06.html#l171">6.7.1: Case-insensitive matching</a></dt>
<dt><a href="zshguide06.html#l172">6.7.2: Matching option names</a></dt>
<dt><a href="zshguide06.html#l173">6.7.3: Partial word completion</a></dt>
<dt><a href="zshguide06.html#l174">6.7.4: Substring completion</a></dt>
<dt><a href="zshguide06.html#l175">6.7.5: Partial words with capitals</a></dt>
<dt><a href="zshguide06.html#l176">6.7.6: Final notes</a></dt>
</dl>
<dt><h3><a href="zshguide06.html#l177">6.8: Tutorial</a></h3></dt>
<dl>
<dt><a href="zshguide06.html#l178">6.8.1: The dispatcher</a></dt>
<dt><a href="zshguide06.html#l179">6.8.2: Subcommand completion: <code>_arguments</code></a></dt>
<dt><a href="zshguide06.html#l180">6.8.3: Completing particular argument types</a></dt>
<dt><a href="zshguide06.html#l181">6.8.4: The rest</a></dt>
</dl>
<dt><h3><a href="zshguide06.html#l182">6.9: Writing new completion functions and widgets</a></h3></dt>
<dl>
<dt><a href="zshguide06.html#l183">6.9.1: Loading completion functions: <code>compdef</code></a></dt>
<dt><a href="zshguide06.html#l184">6.9.2: Adding a set of completions: <code>compadd</code></a></dt>
<dt><a href="zshguide06.html#l185">6.9.3: Functions for generating filenames, etc.</a></dt>
<dt><a href="zshguide06.html#l186">6.9.4: The <code>zsh/parameter</code> module</a></dt>
<dt><a href="zshguide06.html#l187">6.9.5: Special completion parameters and <code>compset</code></a></dt>
<dt><a href="zshguide06.html#l188">6.9.6: Fancier completion: using the tags and styles mechanism</a></dt>
<dt><a href="zshguide06.html#l189">6.9.7: Getting the work done for you: handling arguments etc.</a></dt>
<dt><a href="zshguide06.html#l190">6.9.8: More completion utility functions</a></dt>
</dl>
<dt><h3><a href="zshguide06.html#l191">6.10: Finally</a></h3></dt>
</dl>
<dt><h2><a href="zshguide07.html#l192">Chapter 7: Modules and other bits and pieces <em>Not written</em></a></h2></dt>
<dl>
<dt><h3><a href="zshguide07.html#l193">7.1: Control over modules: <code>zmodload</code></a></h3></dt>
<dl>
<dt><a href="zshguide07.html#l194">7.1.1: Modules defining parameters</a></dt>
<dt><a href="zshguide07.html#l195">7.1.2: Low-level system interaction</a></dt>
<dt><a href="zshguide07.html#l196">7.1.3: ZFTP</a></dt>
</dl>
<dt><h3><a href="zshguide07.html#l197">7.2: Contributed bits</a></h3></dt>
<dl>
<dt><a href="zshguide07.html#l198">7.2.1: Prompt themes</a></dt>
</dl>
<dt><h3><a href="zshguide07.html#l199">7.3: What's new in 4.1</a></h3></dt>
</dl>
<dt><h2><a href="zshguide08.html#l200">Appendix 1: Obtaining zsh and getting more information <em>Not written</em></a></h2></dt>
</dl>

<p><hr><p>
<p>
</body>
</html>
